<?php
$this->breadcrumbs=array(
	'Families'=>array('index'),
	$model->name,
);
?>

<h1>View Family #<?php echo $model->id; ?></h1>

<div>
	<?php
	$properties = array(
		'items'=>$model->getMenu($this->action->id, true),
		'htmlOptions'=>array(
			'class'=>'operations',
		),
		'encodeLabel'=>false,
	);
	$this->widget('zii.widgets.CMenu', $properties);
	?>
</div>

<hr />

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'name',
		'gender',
		array(
			'type'=>'raw',
			'label'=>$model->getattributeLabel('relation'),
			'value'=>$model->relation . ' of ' . $model->employee->name,
		)
	),
)); ?>

<h2 class="prepend-top bottom">Insurances</h2>

<?php
$view = 'Yii::app()->createUrl("insurance/view", array("id"=>$data->id))';
$update = 'Yii::app()->createUrl("insurance/update", array("id"=>$data->id))';
$properties = array(
	'dataProvider'=>$model->getDataProvider('insurances'),
	'columns'=>array(
		'name',
		'code',
		array(
			'name'=>'unixValidFrom',
			'type'=>'date',
			'header'=>$model->getAttributeLabel('validFrom'),
		),
		array(
			'name'=>'unixValidUntil',
			'type'=>'date',
			'header'=>$model->getAttributeLabel('validUntil'),
		),
		array(
			'class'=>'CButtonColumn',
			'template'=>'{view} {update}',
			'buttons'=>array(
				'view'=>array(
					'url'=>$view,
				),
				'update'=>array(
					'url'=>$update,
				),
			),
		),
	),
);
$this->widget('zii.widgets.grid.CGridView', $properties);
?>
